GetComparerFromComparison Generic Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Given a comparison delegate that compares two items of type T, gets an IComparer<T> instance that performs the same comparison.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public static IComparer<T> GetComparerFromComparison<T>(
	Comparison<T> comparison
)
Visual Basic (Declaration)
Public Shared Function GetComparerFromComparison(Of T) ( _
	comparison As Comparison(Of T) _
) As IComparer(Of T)
Visual C++
public:
generic<typename T>
static IComparer<T>^ GetComparerFromComparison (
	Comparison<T>^ comparison
)

Parameters

comparison
Comparison<(Of <T>)>
The comparison delegate to use.

Return Value

An IComparer<T> that performs the same comparing operation as comparison.

Type Parameters

T

See Also